package com.ruoyi.sl.mapper;

import java.util.Date;
import java.util.List;
import com.ruoyi.sl.domain.SlOddjob;
import com.ruoyi.sl.domain.SlOddjobOmember;
import com.ruoyi.sl.domain.SlRwork;
import org.apache.ibatis.annotations.Param;

/**
 * 零工报工Mapper接口
 * 
 * @author admin
 * @date 2024-06-11
 */
public interface SlOddjobMapper 
{

    //获报工单ID和参与人获取参与人的所有报工项
    public List<SlOddjob> selectSlOddjobListByRfworkIdAndMember(@Param("rfworkId") Long rfworkId, @Param("memberUser") String memberUser);

    /**
     * 查询零工报工
     * 
     * @param oddjobId 零工报工主键
     * @return 零工报工
     */
    public SlOddjob selectSlOddjobByOddjobId(Long oddjobId);

    /**
     * 查询零工报工列表
     * 
     * @param slOddjob 零工报工
     * @return 零工报工集合
     */
    public List<SlOddjob> selectSlOddjobList(SlOddjob slOddjob);

    /**
     * 查询零工报工列表
     *
     * @param oddjobDate 日期
     * @return 零工报工集合
     */
    public List<SlOddjob> selectSlOddjobUserListByDate(Date oddjobDate);



    /**
     * 所有已通过审核的零工报工单
     *
     * @return 集合
     */
    public List<SlOddjob> selectAllApprovedSlOddjobList();

    /**
     * 所有未提交的报工项
     *
     * @return 集合
     */
    public List<SlOddjob> selectSlOddjobListByNoSubmit(SlOddjob slOddjob);

    /**
     * 根据报工单ID查询所有报工项
     *
     * @return 集合
     */
    public List<SlOddjob> selectSlOddjobListByRfworkId(Long rfworkId);

    /**
     * 新增零工报工
     * 
     * @param slOddjob 零工报工
     * @return 结果
     */
    public int insertSlOddjob(SlOddjob slOddjob);

    /**
     * 修改零工报工
     * 
     * @param slOddjob 零工报工
     * @return 结果
     */
    public int updateSlOddjob(SlOddjob slOddjob);

    /**
     * 删除零工报工
     * 
     * @param oddjobId 零工报工主键
     * @return 结果
     */
    public int deleteSlOddjobByOddjobId(Long oddjobId);

    /**
     * 批量删除零工报工
     * 
     * @param oddjobIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSlOddjobByOddjobIds(Long[] oddjobIds);

    /**
     * 批量删除零工操作人
     * 
     * @param oddjobIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSlOddjobOmemberByOddjobIds(Long[] oddjobIds);
    
    /**
     * 批量新增零工操作人
     * 
     * @param slOddjobOmemberList 零工操作人列表
     * @return 结果
     */
    public int batchSlOddjobOmember(List<SlOddjobOmember> slOddjobOmemberList);
    

    /**
     * 通过零工报工主键删除零工操作人信息
     * 
     * @param oddjobId 零工报工ID
     * @return 结果
     */
    public int deleteSlOddjobOmemberByOddjobId(Long oddjobId);


    /**
     * 将报工单的审核标记改为3，已计算工资
     *
     * @param oddjobId 报工单ID
     * @return 结果
     */
    public int updateSlOddjobToOver(Long oddjobId);
}
